﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace test_ASPnet
{
    public partial class _Default : Page
    {

        private int a;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ds2_Selected(object sender, SqlDataSourceStatusEventArgs e)
        {
         a = e.AffectedRows;
         Label5.Text =a.ToString();
         txtRekCount.Text = a.ToString(); 
        }

        protected void ds2_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
        {
        
        }

        private int maxRekToUpdate(int b)
        {
            
            if(b>a)
            {
                return a;
            }
            return b;
            
        }

        protected void txtRekCount_TextChanged(object sender, EventArgs e)
        {
            Int32 i = System.Convert.ToInt32(txtRekCount.Text);
            
            txtRekCount.Text = maxRekToUpdate(i).ToString();
        }


        }
    }
